#include "operatelogdetaildlg.h"
#include "ui_operatelogdetaildlg.h"

OperateLogDetailDlg::OperateLogDetailDlg(OperateLog log,QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::OperateLogDetailDlg)
{
    ui->setupUi(this);
    setWindowIcon(QIcon(":/image/res/stm.jpg"));
    this->log = log;
    init();
}

OperateLogDetailDlg::~OperateLogDetailDlg()
{
    delete ui;
}

void OperateLogDetailDlg::init()
{
    ui->label_operateModule->setText(log.title);
    ui->label_requestLocation->setText(log.operUrl);
    ui->label_loginInfo->setText(log.operName + "/" + log.operIp + "/" + log.operLocation);
    ui->label_requestMethod->setText(log.requestMethod);
    ui->label_operateMethod->setText(log.method);
    ui->label_requestParam->setText(log.operParam);
    ui->label_responseParam->setText(log.jsonResult);
    ui->label_operateStatus->setText(log.status == 0 ? "正常" : "失败");
    ui->label_operateTime->setText(log.operTime);
}

void OperateLogDetailDlg::on_btn_close_clicked()
{
    close();
}

